package cn.jane.rpc.netty.server;

import cn.jane.rpc.netty.transport.RequestHandler;
import cn.jane.rpc.netty.transport.ServiceTypes;
import cn.jane.rpc.netty.transport.command.Command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

public class RpcRequestHandler implements RequestHandler, ServiceProviderRegistry {

    private static final Logger logger = LoggerFactory.getLogger(RpcRequestHandler.class);

    /**
     * 服务名称与服务提供者的映射，key：服务名称，value：服务提供者 TODO 服务提供者应该有一个公共父类
     */
    private final Map<String, Object> serviceProviderMap = new HashMap<>();


    @Override
    public <T> void addServiceProvider(T serviceProvider, Class<? extends T> serviceClass) {

    }

    @Override
    public Command handle(Command requestCommand) {
        return null;
    }

    @Override
    public int type() {
        return ServiceTypes.TYPE_RPC_REQUEST;
    }
}
